package com.carlinfo.users.pojo;

import java.util.Date;

/**
 * @author Gonsen 新闻实体类
 */
public class ANews {

	private int id;// id
	private String title;//网页上显示的
	private String imgPath; //图片路径
	private String source; //来源
	private String author; //作者
	private String brief; //新闻的简介
	private String content; //内容描述
	private byte status; //状态：0禁用  1启用
	private Date createTime;//创建时间
	private Date updateTime;//更新时间
	private Date pubTime; //发布时间（用来排序）
	private String keywords;
	
	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}
	/*添加一个枚举类用于状态的描述,状态的字符串描述*/
	private String statusStr;
	
	public String getStatusStr() {
		ANewsEnum[] newsEnmus = ANewsEnum.values();
		for (int i = 0; i < newsEnmus.length; i++) {
			ANewsEnum newsEnmu = newsEnmus[i];
			if(newsEnmus.toString().startsWith("STATUS")){
				if(this.getStatus() == newsEnmu.getStatus()){
					this.statusStr = newsEnmu.getName();
				}
			}
		}
		return statusStr;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getImgPath() {
		return imgPath;
	}
	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getBrief() {
		return brief;
	}
	public void setBrief(String brief) {
		this.brief = brief;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public byte getStatus() {
		return status;
	}
	public void setStatus(byte status) {
		this.status = status;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public Date getPubTime() {
		return pubTime;
	}
	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}

	@Override
	public String toString() {
		return "ANews [id=" + id + ", title=" + title + ", imgPath=" + imgPath + ", source=" + source
				+ ", author=" + author + ", brief=" + brief + ", content=" + content + ", status=" + status
				+ ", createTime=" + createTime + ", updateTime=" + updateTime + ", pubTime=" + pubTime + ", keywords="
				+ keywords + ", statusStr=" + statusStr + "]";
	}
	
	
}
